remotemanager.serialisation.serial module

class remotemanager.serialisation.serial.serial[source]

Baseclass for holding serialisation methods. Subclass this class when implementing new serialisation methods

dump(obj, file: str) None[source]

Dump object obj to file file

Base behaviour tries to write the output of self.dumps to a file. Overwrite for custom behaviour

Parameters:
  • obj – object to be dumped

  • file (str) – filepath to dump to

Returns:

None

load(file: str)[source]

Load previously dumped data from file file

Base behaviour tries to load file via self.dumps Overwrite for custom behaviour

Parameters:

file (str) – filepath to load

Returns:

Stored object

static wrap_to_list(obj)[source]

Preserves the python tying of a set or tuple by inserting an identifier at the start.

If passed with a list starting with this identifier, it will unwrap the typing, restoring the type.

property extension: str

Returns (str): intended file extension

property importstring: str

Returns (str): Module name to import. See subclasses for examples

property callstring: str

Returns (str): Intended string for calling this module’s dump. See subclasses for examples

property bytes: bool

Set to True if serialiser requires open(…, ‘wb’)

property write_mode

Mode for writing to dumped files.

property read_mode

Mode for reading dumped files.